<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><{$site_title}>管理中心</title>
<{include file="js.html"}>
<link type="text/css" rel="stylesheet" href="css/validator.css"></link>
<script src="js/formValidator.js" type="text/javascript"></script>
<script src="js/formValidatorRegex.js" type="text/javascript"></script>
<script>
	$(document).ready(
		function(){
			$.formValidator.initConfig({formID:"myForm",onError:function(msg){alert(msg);return false;},onSuccess:function(){return true;}});
			$("#name").formValidator({})
			.inputValidator({min:1,max:50,onError: "用户名为1到50位的字符"})
		    .ajaxValidator({
			    type : "get",
				url : "admin_add.php?action=name",
				datatype : "json",
				success : function(data){
		            if( data == "1" )
					{
		                return true;
					}
		            else
					{
		                return false;
					}
				},
				Error: function(){alert("服务器没有返回数据，可能服务器忙，请重试");},
				onError : "用户名已存在，请重新输入",
				onWait : "正在对用户名进行合法性校验，请稍候..."
			});
			$("#pwd").formValidator({}).inputValidator({min:1,onError: "用户名为1到50位的字符"})
			$("#pwd2").formValidator({forcevalID:true,triggerEvent:"change"}).inputValidator({min:1,empty:{leftEmpty:false,rightEmpty:false,emptyError:"重复密码两边不能有空符号"},onError:"重复密码不能为空,请确认"}).compareValidator({desID:"pwd",operateor:"=",onError:"2次密码不一致,请确认"});
			$("#group_id").formValidator({}).inputValidator({min:1,onError: "请选择权限分组"})
		}
	)

$(function(){
	$("#myForm").submit(function(){
		return queding('是否保存设置？','');
	})
})
</script>
</head>

<body>
<div class="box">
<div style="background:url(images/mainbj.jpg) repeat-x; line-height:31px; height:31px;">
<table width="262" height="31" border="0" cellpadding="0" cellspacing="0">
<tr><td width="41" align="center">
<img src="images/biao1.jpg" /></td>
<td width=""><strong>当前位置</strong>：管理员 &gt; 添加管理员</td>
</tr></table>
</div>

<form action="" method="post" name="myForm" id="myForm">
<table class="lefttab" cellpadding="0" cellspacing="0">
<tr><td colspan="3"><div style="height:26px; text-align:left; line-height:26px; background:url(images/xbj1.jpg) repeat-x; border:1px solid #e9f5fa;font-weight:bold;">&nbsp;&nbsp;添加管理员</div>
</td></tr>
<tr>
  <td width="100" align="right"><font color="#e47c02">*</font> <strong>用户名</strong>：</td>
  <td width="310" align="left">&nbsp;<input type="text" name="name" id="name" size="20"/></td>
</tr>
<tr>
  <td align="right"><font color="#e47c02">*</font> <strong>密码</strong>：</td>
  <td align="left">&nbsp;<input type="password" name="pwd" id="pwd" size="40"/></td>
</tr>
<tr>
  <td align="right"><font color="#e47c02">*</font> <strong>重复密码</strong>：</td>
  <td align="left">&nbsp;<input type="password" name="pwd2" id="pwd2" size="40"/></td>
</tr>
<tr>
  <td align="right"><font color="#e47c02">*</font> <strong>权限</strong>：</td>
  <td align="left">&nbsp;
  <select id="group_id" name="group_id">
	<option value="">请选择权限</option>
	<{foreach item=loop from=$group}>
	<option value="<{$loop.id}>"><{$loop.group_name}></option>
	<{/foreach}>
  </select>
  </td>
</tr>
<tr><td height="50px" colspan="2">
	<p>&nbsp;</p>
    <p align="left" style="margin-left:100px;">
      &nbsp;&nbsp;<input type="submit" name="submit" value="保存" class="inp"/>
      </p>    <p>&nbsp;</p></td>
  </tr>
</table>
</form>

</div>
</body>
</html>